﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetDon.OA.Business.eLogitics;
using NetDon.OA.Interface.eLogistics;
using NetDon.OA.Portal;
using NetDon.Utilities;

namespace NetDon.OA.Portal.eLogisticsQuery
{

    [Navigation("报表查询", "运输异常统计")]
    public partial class GoodsShippingExceptionQueryPage : PageBase
    {

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                ddlCompany.InsertEmptyItem(ListEmptyType.Select);

            }
            if (!this.IsSuperRoles())
            {
                ddlCompany.SelectedValue = CurrentApplicationContext.CompanyId.ToString();
                ddlCompany.Enabled = false;
            }
        }



        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

        }

        public void btnSearch_Click(object sender, EventArgs e)
        {
            HttpContext.Current.Session["GoodsShippingExceptionQuery"] = GetSearchCriteria();
            this.ScriptStartup("search();");
        }

        protected GoodsShippingExceptionQueryCriteria GetSearchCriteria()
        {
            var criteria = new GoodsShippingExceptionQueryCriteria
            {

            };
            if (!MiscUtilities.IsNullOrEmpty(ddlCompany.SelectedValue))
            {
                criteria.AreaId = ddlCompany.SelectedValue.ToGuid();
            }
            if (!MiscUtilities.IsNullOrEmpty(ddlRouteTypeId.SelectedValue.ToGuid()))
            {
                criteria.RouteTypeId = ddlRouteTypeId.SelectedValue.ToGuid();
            }


            return criteria;
        }

    }


}